<%--
  Main Page
  This page is main page which has the invisible applet inside
  and other pages as iframe, so that applet does not need to
  refresh while we change pages, because this page does not refresh
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Main Page</title>
</head>
<body>

    <script>

        /**
         * Called from WebLoginApplet and prints the passed
         * certificates, which are found by applet, to the form
         * @param certs certificates found by applet in smart cards of connected terminals
         */
        function setLoginFormCerts(certs) {
            document.getElementById('myframe').contentDocument.getElementById('certOptions').innerHTML = certs;
        }

        /**
         * Called from WebLoginApplet and prints the passed base64 signature value to the login form
         * @param signature created by applet
         */
        function setSignature64(signature) {
            document.getElementById('myframe').contentDocument.getElementById("signature64").value = signature;
        }

        /**
         * Can be used to pop-up message from applet
         * @param msg
         */
        function check(msg) {
            alert(msg);
        }

    </script>

    <applet name="webloginapplet" code="tr.gov.tubitak.uekae.applet.light.LightApplet"
            archive=
                    "new-applet.jar,

                    lib/ma3api-common-1.4.16-20130709.210842-133.jar,
                    lib/ma3api-smartcard-1.4.16-20130804.213646-172.jar,

                    lib/slf4j-api-1.6.6.jar,
                    lib/slf4j-log4j12-1.6.6.jar,
                    lib/log4j-1.2.17.jar, a.jar"

            width="0" height="0" MAYSCRIPT>
    </applet>

    <!--applet name="webloginapplet" code="tr.gov.tubitak.uekae.applet.WebLoginApplet"
            archive=
                    "new-applet.jar,

                    lib/ma3api-asn-1.4.16-20130709.211525-141.jar,
                    lib/ma3api-certstore-1.4.16-20130709.212742-127.jar,
                    lib/ma3api-certvalidation-1.4.16-20130709.215312-132.jar,
                    lib/ma3api-cmssignature-1.4.16-20130722.134025-125.jar,
                    lib/ma3api-common-1.4.16-20130709.210842-133.jar,
                    lib/ma3api-crypto-1.4.16-20130709.212220-127.jar,
                    lib/ma3api-crypto-gnuprovider-1.4.16-20130709.212357-127.jar,
                    lib/ma3api-crypto-sunprovider-1.4.16-20130709.212250-127.jar,
                    lib/ma3api-infra-1.4.16-20130709.214837-127.jar,
                    lib/ma3api-signature-1.4.16-20130722.133140-138.jar,
                    lib/ma3api-smartcard-1.4.16-20130804.213646-172.jar,
                    lib/ma3api-xmlsignature-1.4.16-20130722.134742-97.jar,

                    lib/akiscif-2.4.7.jar,
                    lib/asn1rt-6.42.jar,

                    lib/slf4j-api-1.6.6.jar,
                    lib/slf4j-log4j12-1.6.6.jar,
                    lib/log4j-1.2.17.jar, a.jar"

            width="0" height="0" MAYSCRIPT>
    </applet-->

    <iframe id="myframe" name="myframe" src="index.jsp" width="700" height="300">
    </iframe>

</body>
</html>